import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createVNode, createCommentVNode, createElementVNode, toDisplayString, createTextVNode, resolveDynamicComponent, unref } from "vue";
const toLine = (value) => {
  return value.replace(/(A-Z)/g, "-$1").toLocaleLowerCase();
};
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const _hoisted_1 = {
  key: 0,
  class: "avatar"
};
const _hoisted_2 = { class: "content" };
const _hoisted_3 = {
  key: 0,
  class: "title"
};
const _hoisted_4 = {
  key: 1,
  class: "time"
};
const _hoisted_5 = {
  key: 2,
  class: "time"
};
const _hoisted_6 = { class: "action" };
const _hoisted_7 = ["onClick"];
const _hoisted_8 = {
  key: 0,
  class: "icon"
};
const _hoisted_9 = { key: 1 };
const _sfc_main = /* @__PURE__ */ defineComponent({
  name: "index",
  props: {
    list: null,
    actions: null
  },
  emits: ["clickItem", "clickAcition"],
  setup(__props, { emit: emits }) {
    const clickItem = (item, i) => {
      emits("clickItem", item, i);
    };
    const clickAcition = (item, i) => {
      if (item.func) {
        item.func();
      } else {
        emits("clickAcition", item, i);
      }
    };
    return (_ctx, _cache) => {
      const _component_el_avatar = resolveComponent("el-avatar");
      const _component_el_tag = resolveComponent("el-tag");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_el_tab_pane = resolveComponent("el-tab-pane");
      const _component_el_tabs = resolveComponent("el-tabs");
      return openBlock(), createBlock(_component_el_tabs, { stretch: true }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item, index2) => {
            return openBlock(), createBlock(_component_el_tab_pane, {
              key: index2,
              label: item.title,
              onClick: ($event) => clickItem(item, index2)
            }, {
              default: withCtx(() => [
                createVNode(_component_el_scrollbar, { "max-height": 300 }, {
                  default: withCtx(() => [
                    (openBlock(true), createElementBlock(Fragment, null, renderList(item.content, (cont, i) => {
                      return openBlock(), createElementBlock("div", {
                        key: i,
                        class: "container"
                      }, [
                        cont.avatar ? (openBlock(), createElementBlock("div", _hoisted_1, [
                          createVNode(_component_el_avatar, {
                            src: cont.avatar
                          }, null, 8, ["src"])
                        ])) : createCommentVNode("", true),
                        createElementVNode("div", _hoisted_2, [
                          cont.title ? (openBlock(), createElementBlock("div", _hoisted_3, [
                            createElementVNode("span", null, toDisplayString(cont.title), 1),
                            cont.tag ? (openBlock(), createBlock(_component_el_tag, {
                              key: 0,
                              type: cont.tagType,
                              size: "small"
                            }, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(cont.tag), 1)
                              ]),
                              _: 2
                            }, 1032, ["type"])) : createCommentVNode("", true)
                          ])) : createCommentVNode("", true),
                          cont.time ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(cont.time), 1)) : createCommentVNode("", true),
                          cont.desc ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(cont.desc), 1)) : createCommentVNode("", true)
                        ])
                      ]);
                    }), 128))
                  ]),
                  _: 2
                }, 1024),
                createElementVNode("div", _hoisted_6, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (item1, i) => {
                    return openBlock(), createElementBlock("div", {
                      key: i,
                      class: "action-item",
                      onClick: ($event) => clickAcition(item1, i)
                    }, [
                      item1.icon ? (openBlock(), createElementBlock("div", _hoisted_8, [
                        (openBlock(), createBlock(resolveDynamicComponent(`el-icon-${unref(toLine)(item1.icon)}`)))
                      ])) : createCommentVNode("", true),
                      item1.text ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(item1.text), 1)) : createCommentVNode("", true)
                    ], 8, _hoisted_7);
                  }), 128))
                ])
              ]),
              _: 2
            }, 1032, ["label", "onClick"]);
          }), 128))
        ]),
        _: 1
      });
    };
  }
});
var list = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b1f21a76"]]);
var index = {
  install(app) {
    app.component("MnList", list);
  }
};
export { index as default };
